<?php include $this->tpl('public:common.php') ?>

<div class="btn-toolbar"  style="margin-bottom:2px;">
    <a href="/os/menu/add"  class="btn btn-primary"><i class="icon-plus"></i> 功能</a>
	<a data-toggle="collapse" data-target="#search"  href="#" title= "检索"><button class="btn btn-primary" style="margin-left:5px"><i class="icon-search"></i></button></a>
</div>
<?php if(get('search')):?>
<div id="search" class="collapse in">
<?php else:?>
<div id="search" class="collapse out" >
<?php endif ?>
<form class="form_search"  action="" method="GET" style="margin-bottom:0px">
	<div style="float:left;margin-right:5px">
		<label>选择菜单模块</label>
		<select name="module_id" id="DropDownTimezone" class="input-xlarge">
			<?php foreach ($module_options_list as $_val=>$_name):?>
				<option value="<?= $_val?>"<?=get('module_id',0,'absint')==$_val ? ' selected' : ''?>><?=$_name?></option>
			<?php endforeach?>
		</select>
	</div>
	<div style="float:left;margin-right:5px">
		<label>查询所有请留空</label>
		<input type="text" name="menu_name" value="<?=get('menu_name','','htmlspecialchars')?>" placeholder="输入菜单名称" > 
		<input type="hidden" name="search" value="1" >
	</div>
	<div class="btn-toolbar" style="padding-top:25px;padding-bottom:0px;margin-bottom:0px">
		<button type="submit" class="btn btn-primary">检索</button>
	</div>
	<div style="clear:both;"></div>
</form>
</div>

    <div class="block">
        <a href="#page-stats" class="block-heading" data-toggle="collapse">功能列表</a>
        <div id="page-stats" class="block-body collapse in">

               <table class="table table-striped">
              <thead>
                <tr>
					<th style="width:30px">#</th>
					<th style="width:90px">名称</th>
					<th style="width:180px">URL</th>
					<th style="width:80px">所属模块</th>
					<th style="width:80px">菜单</th>
					<th style="width:80px">所属菜单</th>
					<th style="width:80px">是否在线</th>
					<th style="width:80px">快捷菜单</th>
					<th style="width:180px">描述</th>
					<th style="width:80px">操作</th>
                </tr>
              </thead>
              <tbody>							  
					 <?php foreach ($menus as $menu):?>
					<tr>
					 
					<td><?=$menu['menu_id']?></td>
					<td><?=$menu['menu_name']?></td>
					<td><?=$menu['menu_url']?></td>
					<td><?=$module_options_list[$menu['module_id']]?></td>
					<td>
					<?php if($menu['is_show']):?>
						是
					<?php else:?>
						否
					<?php endif ?>
					</td>
					<td><?php if($menu['father_menu']>0):?><?=$menu['father_menu_name']?><?php endif ?></td>
					
					<td>
					<?php if($menu['online']):?>
						在线
					<?php else:?>
						已下线
					<?php endif ?></td>
					<td>
					<?php if($menu['shortcut_allowed']):?>
						允许
					<?php else:?>
						不允许
					<?php endif ?>
					</td>
					<td><?=$menu['menu_desc']?></td>
				
					<td>
					<a href="/os/menu/update?menu_id=<?=$menu['menu_id']?>" title= "修改" ><i class="icon-pencil"></i></a>
					
					<?php if($menu['menu_id'] > 100):?>
					&nbsp;
					<a data-toggle="modal" href="#myModal" title= "删除" ><i class="icon-remove" href="/os/menus/delete?page_no=<?=$page_no?>&menu_id=<?=$menu['menu_id']?>" ></i></a>
					<?php endif ?>
					</td>
					</tr>
				<?php endforeach?>
              </tbody>
            </table> 
<!--- START 分页模板 --->
               <?=$page_html?>
<!--- END 分页--->			   
        </div>
    </div>
	
<?php include $this->tpl("public:footer.php" ) ?>